<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品预览</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 360px;
            margin: 100px auto;
            padding-top: 360px;
            border: 1px solid gray;
            background: url(./01big.jpg) no-repeat;
        }

        .box>ul {
            list-style: none;
            height: 70px;
            border-top: 1px solid gray;
        }

        .box>ul>li {
            float: left;
            /* 鼠标变成小手 */
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div class="box">
        <ul>
            <li><img src="./01.jpg" alt="小图"></li>
            <li><img src="./02.jpg" alt="小图"></li>
            <li><img src="./03.jpg" alt="小图"></li>
            <li><img src="./04.jpg" alt="小图"></li>
            <li><img src="./05.jpg" alt="小图"></li>
        </ul>
    </div>
    <script>
        window.onload = function () {
            var imgs = document.querySelectorAll("img")
            var box = document.querySelector(".box")
            for (let i = 0; i < imgs.length; i++) {
                imgs[i].onmouseover = function () {
                    box.style.backgroundImage = 'url(./0'+(i+1)+'big.jpg)'
                }
            }

        }
    </script>
</body>

</html>